home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-02-25 | 5.3 KB | 230 lines | [TEXT/MPS ] |
- UNIT SVEditGlobals;
- (*
- SVEditGlobals.p
-
- Version 3.0d8
-
- Copyright © SRL Data 1992, 1993
-
- All rights reserved
-
- Produced by : SRL Data
- Originally Developed for UK.DTS
- *)
-
- {
- This example is brought to you for the purposes of exploration and experimentation of
- System 7.0. It is not intended to form the basis of your own programs- but try out the code-
- that's what it's there for
- }
-
- {
- About the data structures-
- SectRecord -:
- this is our own record type used for holding specific information about Publisher
- or Subscriber sections. A linked list of SectHandles is referenced from the document
- record. A SectHandle is stored in the refcon field of the Edition Manager section record- the
- same idea as hooking up the document record to the refcon of the WindowRecord.
-
- DocRec -:
- This is used for storing document records containing Font, Size and Style information.
-
- HeaderRec -:
- This is then stored as a 'TFSS' resource (standing for Text Font, Size and Style) which is
- stored in the resource fork of a document file. It also now includes stuff for storing
- the number of sections in a document and the lastsectionID
-
- New for 3.0d2 :
-
- 27-Feb-92 : NH : Add comment, zap test menu stuff,
- remove unneeded constants,
- move others to SVEditWindow.p, zap gCurrSection
-
- Changes for 3.0d4 :
-
- 3-Jul-92 : NH : Remove kAEAskUser
- Remove kAEYes,kAENo - now in AERegistry.h
- 5-Aug-92 : NH : Added SVEditAppSig, gNewDocCount
-
- Changes for 3.0d5 :
-
- 21-Aug-92 : NH : Added everSaved, gNewDocCount
- }
-
- INTERFACE
-
- USES
- MemTypes, QuickDraw, OSIntf, ToolIntf, Traps, Editions, Printing;
-
-
- CONST
-
- WindowID = 128;
- ErrorAlert = 256;
- AdviseAlert = 257;
-
- (*
- Menu Resource IDs
- *)
- appleID = 128;
- fileID = 129;
- editID = 130;
- fontID = 131;
- sizeID = 132;
- styleID = 133;
-
- kLastID = 133;
-
- (*
- Items in Apple Menu
- *)
- aboutItem = 1;
-
- (*
- Items in File Menu
- *)
- fmNew = 1;
- fmOpen = 2;
- fmClose = 4;
- fmSave = 5;
- fmSaveAs = 6;
- fmRevert = 7;
- fmPageSetUp = 9;
- fmPrint = 10;
- fmQuit = 12;
-
- (*
- Items in Edit Menu
- *)
- undoCommand = 1;
- cutCommand = 3;
- copyCommand = 4;
- pasteCommand = 5;
- clearCommand = 6;
- selectAllCommand = 7;
-
- cPublisher = 9;
- cSubscriber = 10;
- cOptions = 11;
- cBorders = 12;
-
- (*
- Items in Style Menu
- *)
- cPlain = 1;
- cBold = 2;
- cItalic = 3;
- cUnderline = 4;
- cOutline = 5;
- cShadow = 6;
- cCondense = 7;
- cExtend = 8;
-
- (*
- Entry of Menu in myMenus
- *)
- appleM = 0;
- fileM = 1;
- editM = 2;
- fontM = 3;
- sizeM = 4;
- styleM = 5;
- kLastMenu = 5;
-
- (*
- Save Changes Dialog Items
- *)
- aaSave = 1;
- aaDiscard = 2;
- aaCancel = 3;
-
- kOSEvent = app4Evt; {event used by MultiFinder}
- kSuspendResumeMessage = 1; {high byte of suspend/resume event message}
- kResumeMask = 1; {bit of message field for resume vs. suspend}
- kMouseMovedMessage = $FA; {high byte of mouse-moved event message}
- kNoEvents = 0; {no events mask}
-
- TYPE
-
- {Forward decl - Shuts Compiler Up}
-
- DHandle = ^DPtr;
- DPtr = ^DocRec;
-
- {this is a section record to hold the information about the publishers and subscribers}
- {in this document}
-
- SectHandle = ^SectPtr;
- SectPtr = ^SectRec;
- SectRec = RECORD
- fSectHandle : SectionHandle;
- fSectionID : INTEGER;
- fBorderRgn : RgnHandle; {handle to the outside border}
- fInnerBounds : RECT;
- fStart : INTEGER; {fStart and fEnd are both specific to a}
- fEnd : INTEGER; {text handling application- start and end of text selection}
- fNextSection : SectHandle;
- fFSSpec : FSSpec;
- fCount : INTEGER;
- fTextHandle : Handle;
- fChanged : BOOLEAN; {has the section been changed}
- fDocument : DPtr;
- END;
-
- DocRec = record
- theText : TEHandle;
- vscrollBar : ControlHandle;
- hscrollBar : ControlHandle;
- theWindow : WindowPtr;
- dirty : BOOLEAN;
- refNum : INTEGER;
- theFont : INTEGER;
- theSize : INTEGER;
- theStyle : STYLE;
- theFileName : STR255;
- firstSection : SectHandle; {the first section in the list}
- lastSection : SectHandle; {the last section}
- numSections : INTEGER;
- theFSSpec : FSSpec;
- lastID : INTEGER; {the last sectionID}
- thePrintSetup : THPrint;
- pageSize : Rect; {From thePrintSetUp^^.prInfo.rPage but 0 offset}
- showBorders : BOOLEAN;
- everSaved : BOOLEAN;
- end;
-
- HHandle = ^HPtr;
- HPtr = ^HeaderRec;
- headerRec = record
- theFont : STR255; {stored as a FontName}
- theSize : INTEGER;
- theStyle : Style;
- theLength : INTEGER;
- numSections : INTEGER;
- lastID : INTEGER;
- end;
-
- var
-
- gWCount : INTEGER;
- gNewDocCount : INTEGER;
- myMenus : Array[AppleM..KLastMenu] of MenuHandle;
- gFontMItem : INTEGER;
- gQuitting : BOOLEAN;
- editCursor : Cursor;
- waitCursor : Cursor;
- gInBackground : BOOLEAN;
-
- {now for the environment variables set up by Gestalt}
-
- gGestaltAvailable : BOOLEAN;
- gAppleEventsImplemented : BOOLEAN;
- gAliasManagerImplemented : BOOLEAN;
- gEditionManagerImplemented : BOOLEAN;
- gOutlineFontsImplemented : BOOLEAN;
- gRecordingImplemented : BOOLEAN;
-
-
- IMPLEMENTATION
-
- END.